<?php
namespace User;
use Zend\ModuleManager\ModuleManager;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\Stdlib\Hydrator\ClassMethods;

class Module implements AutoloaderProviderInterface,
    ConfigProviderInterface,
    ServiceProviderInterface
{
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }


    public function getControllerPluginConfig()
    {
        return array(
            'factories' => array(
                'UserAuthentication' => 'User\Factory\Controller\Plugin\UserAuthenticationFactory' ,
            )
        );
    }

    public function getServiceConfig()
    {
        return array(
            'invokables' => array(
                /*-----------------Service---------------------*/
                'user_service' => 'User\Service\User',
                'User\Authentication\Adapter\Db' => 'User\Authentication\Adapter\Db',
                'User\Authentication\Storage\Db' => 'User\Authentication\Storage\Db',
            ),
            'factories' => array(
                'user_auth_service' => 'User\Factory\AuthenticationServiceFactory' ,
                'User\Authentication\Adapter\AdapterChain'   => 'User\Authentication\Adapter\AdapterChainServiceFactory',
                'user_register_form' => 'User\Factory\Form\RegisterFormFactory',
                'user_login_form'   => 'User\Factory\Form\LoginFormFactory',
		        'user_user_hydrator' => 'User\Factory\Mapper\UserHydratorFactory' ,
                'user_module_options' => 'User\Factory\ModuleOptionsFactory',
		        'user_user_mapper'  => 'User\Factory\UserMapperFactory',
            ),
        );
    }
}
